home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / led / ledvb20 / ledtest.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-06-06  |  18.5 KB  |  568 lines

  1. VERSION 2.00
  2. Begin Form ledtest 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "LED Examples"
  6.    ClientHeight    =   5265
  7.    ClientLeft      =   1440
  8.    ClientTop       =   2145
  9.    ClientWidth     =   6855
  10.    Height          =   5610
  11.    Left            =   1410
  12.    LinkTopic       =   "Form1"
  13.    MDIChild        =   -1  'True
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   9.287
  16.    ScaleMode       =   0  'User
  17.    ScaleWidth      =   12.092
  18.    Top             =   1830
  19.    Width           =   6915
  20.    Begin LED LED8 
  21.       AutoSize        =   -1  'True
  22.       BackColor       =   &H00C0C0C0&
  23.       BevelInner      =   0  ' 0 - None
  24.       BevelOuter      =   0  ' 0 - None
  25.       BevelWidth      =   2
  26.       BorderHorizontal=   0
  27.       BorderVertical  =   0
  28.       BorderWidth     =   0
  29.       DecayRate       =   0
  30.       Direction       =   0  ' 0 - Forward
  31.       Height          =   225
  32.       LEDColor        =   LEDTEST.FRX:0000
  33.       LEDHeight       =   15
  34.       LEDIndex        =   0
  35.       LEDSep          =   3
  36.       LEDStyle        =   2  ' 2 - Bitmap
  37.       LEDWidth        =   30
  38.       Left            =   240
  39.       MaxDecay        =   0   'False
  40.       Mode            =   1  ' 1 - Bitwise
  41.       MouseControl    =   -1  'True
  42.       NumLEDs         =   7
  43.       OffPictureGreen =   LEDTEST.FRX:00C8
  44.       OnPictureGreen  =   LEDTEST.FRX:07D2
  45.       Orientation     =   0  ' 0 - Horizontal
  46.       TabIndex        =   16
  47.       Top             =   2790
  48.       Value           =   240
  49.       Width           =   3420
  50.    End
  51.    Begin LED LED2 
  52.       AutoSize        =   -1  'True
  53.       BackColor       =   &H00C0C0C0&
  54.       BevelInner      =   0  ' 0 - None
  55.       BevelOuter      =   0  ' 0 - None
  56.       BevelWidth      =   3
  57.       BorderHorizontal=   0
  58.       BorderVertical  =   0
  59.       BorderWidth     =   2
  60.       DecayRate       =   0
  61.       Direction       =   0  ' 0 - Forward
  62.       Height          =   360
  63.       LEDColor        =   LEDTEST.FRX:09DC
  64.       LEDHeight       =   20
  65.       LEDIndex        =   0
  66.       LEDSep          =   2
  67.       LEDStyle        =   1  ' 1 - Circular
  68.       LEDWidth        =   20
  69.       Left            =   270
  70.       MaxDecay        =   0   'False
  71.       Mode            =   0  ' 0 - Value
  72.       MouseControl    =   -1  'True
  73.       NumLEDs         =   10
  74.       Orientation     =   0  ' 0 - Horizontal
  75.       TabIndex        =   12
  76.       Top             =   1620
  77.       Value           =   4
  78.       Width           =   3330
  79.    End
  80.    Begin Timer Timer2 
  81.       Interval        =   400
  82.       Left            =   90
  83.       Top             =   660
  84.    End
  85.    Begin LED LED10 
  86.       AutoSize        =   -1  'True
  87.       BackColor       =   &H00C0C0C0&
  88.       BevelInner      =   0  ' 0 - None
  89.       BevelOuter      =   0  ' 0 - None
  90.       BevelWidth      =   2
  91.       BorderHorizontal=   0
  92.       BorderVertical  =   0
  93.       BorderWidth     =   0
  94.       DecayRate       =   0
  95.       Direction       =   0  ' 0 - Forward
  96.       Height          =   450
  97.       LEDColor        =   LEDTEST.FRX:0AA4
  98.       LEDHeight       =   30
  99.       LEDIndex        =   0
  100.       LEDSep          =   0
  101.       LEDStyle        =   2  ' 2 - Bitmap
  102.       LEDWidth        =   15
  103.       Left            =   270
  104.       MaxDecay        =   0   'False
  105.       Mode            =   1  ' 1 - Bitwise
  106.       MouseControl    =   0   'False
  107.       NumLEDs         =   15
  108.       OffPictureGreen =   LEDTEST.FRX:0B6C
  109.       OffPictureRed   =   LEDTEST.FRX:0D8A
  110.       OffPictureYellow=   LEDTEST.FRX:0FA8
  111.       OnPictureGreen  =   LEDTEST.FRX:11C6
  112.       OnPictureRed    =   LEDTEST.FRX:13E4
  113.       OnPictureYellow =   LEDTEST.FRX:1602
  114.       Orientation     =   0  ' 0 - Horizontal
  115.       TabIndex        =   11
  116.       Top             =   2310
  117.       Value           =   32767
  118.       Width           =   3375
  119.    End
  120.    Begin LED LED9 
  121.       AutoSize        =   -1  'True
  122.       BackColor       =   &H00C0C0C0&
  123.       BevelInner      =   0  ' 0 - None
  124.       BevelOuter      =   0  ' 0 - None
  125.       BevelWidth      =   2
  126.       BorderHorizontal=   0
  127.       BorderVertical  =   0
  128.       BorderWidth     =   0
  129.       DecayRate       =   0
  130.       Direction       =   0  ' 0 - Forward
  131.       Height          =   450
  132.       LEDColor        =   LEDTEST.FRX:1820
  133.       LEDHeight       =   30
  134.       LEDIndex        =   0
  135.       LEDSep          =   0
  136.       LEDStyle        =   2  ' 2 - Bitmap
  137.       LEDWidth        =   15
  138.       Left            =   270
  139.       MaxDecay        =   0   'False
  140.       Mode            =   1  ' 1 - Bitwise
  141.       MouseControl    =   -1  'True
  142.       NumLEDs         =   15
  143.       OffPictureRed   =   LEDTEST.FRX:18E8
  144.       OnPictureRed    =   LEDTEST.FRX:1B06
  145.       Orientation     =   0  ' 0 - Horizontal
  146.       TabIndex        =   10
  147.       Top             =   3030
  148.       Value           =   255
  149.       Width           =   3375
  150.    End
  151.    Begin LED LED7 
  152.       AutoSize        =   -1  'True
  153.       BackColor       =   &H00C0C0C0&
  154.       BevelInner      =   1  ' 1 - Raised
  155.       BevelOuter      =   2  ' 2 - Inset
  156.       BevelWidth      =   2
  157.       BorderHorizontal=   0
  158.       BorderVertical  =   0
  159.       BorderWidth     =   2
  160.       DecayRate       =   0
  161.       Direction       =   0  ' 0 - Forward
  162.       Height          =   630
  163.       Index           =   3
  164.       LEDColor        =   LEDTEST.FRX:1D24
  165.       LEDHeight       =   30
  166.       LEDIndex        =   0
  167.       LEDSep          =   10
  168.       LEDStyle        =   2  ' 2 - Bitmap
  169.       LEDWidth        =   30
  170.       Left            =   2760
  171.       MaxDecay        =   0   'False
  172.       Mode            =   1  ' 1 - Bitwise
  173.       MouseControl    =   -1  'True
  174.       NumLEDs         =   1
  175.       OffPictureRed   =   LEDTEST.FRX:1DEC
  176.       OnPictureRed    =   LEDTEST.FRX:1FB6
  177.       Orientation     =   0  ' 0 - Horizontal
  178.       TabIndex        =   9
  179.       Top             =   330
  180.       Value           =   0
  181.       Width           =   630
  182.    End
  183.    Begin LED LED7 
  184.       AutoSize        =   -1  'True
  185.       BackColor       =   &H00C0C0C0&
  186.       BevelInner      =   0  ' 0 - None
  187.       BevelOuter      =   0  ' 0 - None
  188.       BevelWidth      =   0
  189.       BorderHorizontal=   0
  190.       BorderVertical  =   0
  191.       BorderWidth     =   0
  192.       DecayRate       =   0
  193.       Direction       =   0  ' 0 - Forward
  194.       Height          =   600
  195.       Index           =   2
  196.       LEDColor        =   LEDTEST.FRX:2180
  197.       LEDHeight       =   40
  198.       LEDIndex        =   0
  199.       LEDSep          =   10
  200.       LEDStyle        =   2  ' 2 - Bitmap
  201.       LEDWidth        =   40
  202.       Left            =   1950
  203.       MaxDecay        =   0   'False
  204.       Mode            =   1  ' 1 - Bitwise
  205.       MouseControl    =   -1  'True
  206.       NumLEDs         =   1
  207.       OffPictureRed   =   LEDTEST.FRX:2248
  208.       OnPictureRed    =   LEDTEST.FRX:25A6
  209.       Orientation     =   0  ' 0 - Horizontal
  210.       TabIndex        =   8
  211.       Top             =   360
  212.       Value           =   0
  213.       Width           =   600
  214.    End
  215.    Begin LED LED7 
  216.       AutoSize        =   -1  'True
  217.       BackColor       =   &H00C0C0C0&
  218.       BevelInner      =   2  ' 2 - Inset
  219.       BevelOuter      =   1  ' 1 - Raised
  220.       BevelWidth      =   2
  221.       BorderHorizontal=   5
  222.       BorderVertical  =   5
  223.       BorderWidth     =   2
  224.       DecayRate       =   0
  225.       Direction       =   0  ' 0 - Forward
  226.       Height          =   630
  227.       Index           =   1
  228.       LEDColor        =   LEDTEST.FRX:2904
  229.       LEDHeight       =   20
  230.       LEDIndex        =   0
  231.       LEDSep          =   10
  232.       LEDStyle        =   1  ' 1 - Circular
  233.       LEDWidth        =   20
  234.       Left            =   1170
  235.       MaxDecay        =   0   'False
  236.       Mode            =   1  ' 1 - Bitwise
  237.       MouseControl    =   -1  'True
  238.       NumLEDs         =   1
  239.       Orientation     =   0  ' 0 - Horizontal
  240.       TabIndex        =   7
  241.       Top             =   330
  242.       Value           =   0
  243.       Width           =   630
  244.    End
  245.    Begin LED LED7 
  246.       AutoSize        =   -1  'True
  247.       BackColor       =   &H00C0C0C0&
  248.       BevelInner      =   2  ' 2 - Inset
  249.       BevelOuter      =   2  ' 2 - Inset
  250.       BevelWidth      =   2
  251.       BorderHorizontal=   5
  252.       BorderVertical  =   5
  253.       BorderWidth     =   2
  254.       DecayRate       =   0
  255.       Direction       =   0  ' 0 - Forward
  256.       Height          =   630
  257.       Index           =   0
  258.       LEDColor        =   LEDTEST.FRX:29CC
  259.       LEDHeight       =   20
  260.       LEDIndex        =   0
  261.       LEDSep          =   10
  262.       LEDStyle        =   0  ' 0 - Rectangular
  263.       LEDWidth        =   20
  264.       Left            =   390
  265.       MaxDecay        =   0   'False
  266.       Mode            =   1  ' 1 - Bitwise
  267.       MouseControl    =   -1  'True
  268.       NumLEDs         =   1
  269.       Orientation     =   0  ' 0 - Horizontal
  270.       TabIndex        =   6
  271.       Top             =   330
  272.       Value           =   0
  273.       Width           =   630
  274.    End
  275.    Begin LED LED4 
  276.       AutoSize        =   -1  'True
  277.       BackColor       =   &H00C0C0C0&
  278.       BevelInner      =   0  ' 0 - None
  279.       BevelOuter      =   0  ' 0 - None
  280.       BevelWidth      =   3
  281.       BorderHorizontal=   0
  282.       BorderVertical  =   0
  283.       BorderWidth     =   2
  284.       DecayRate       =   0
  285.       Direction       =   1  ' 1 - Backward
  286.       Height          =   360
  287.       LEDColor        =   LEDTEST.FRX:2A94
  288.       LEDHeight       =   20
  289.       LEDIndex        =   0
  290.       LEDSep          =   2
  291.       LEDStyle        =   0  ' 0 - Rectangular
  292.       LEDWidth        =   20
  293.       Left            =   270
  294.       MaxDecay        =   0   'False
  295.       Mode            =   0  ' 0 - Value
  296.       MouseControl    =   -1  'True
  297.       NumLEDs         =   10
  298.       Orientation     =   0  ' 0 - Horizontal
  299.       TabIndex        =   5
  300.       Top             =   1260
  301.       Value           =   4
  302.       Width           =   3330
  303.    End
  304.    Begin LED LED6 
  305.       AutoSize        =   -1  'True
  306.       BackColor       =   &H00C0C0C0&
  307.       BevelInner      =   1  ' 1 - Raised
  308.       BevelOuter      =   2  ' 2 - Inset
  309.       BevelWidth      =   1
  310.       BorderHorizontal=   13
  311.       BorderVertical  =   4
  312.       BorderWidth     =   0
  313.       DecayRate       =   0
  314.       Direction       =   0  ' 0 - Forward
  315.       Height          =   780
  316.       LEDColor        =   LEDTEST.FRX:2B5C
  317.       LEDHeight       =   40
  318.       LEDIndex        =   0
  319.       LEDSep          =   0
  320.       LEDStyle        =   2  ' 2 - Bitmap
  321.       LEDWidth        =   20
  322.       Left            =   930
  323.       MaxDecay        =   0   'False
  324.       Mode            =   1  ' 1 - Bitwise
  325.       MouseControl    =   -1  'True
  326.       NumLEDs         =   16
  327.       OffPictureRed   =   LEDTEST.FRX:2C24
  328.       OnPictureRed    =   LEDTEST.FRX:2E7E
  329.       Orientation     =   0  ' 0 - Horizontal
  330.       TabIndex        =   4
  331.       Top             =   4350
  332.       Value           =   9876
  333.       Width           =   5250
  334.    End
  335.    Begin Frame Frame4 
  336.       BackColor       =   &H00C0C0C0&
  337.       Caption         =   "Max Decay Ex."
  338.       Height          =   3405
  339.       Left            =   4950
  340.       TabIndex        =   2
  341.       Top             =   60
  342.       Width           =   1695
  343.       Begin LED LED5 
  344.          AutoSize        =   -1  'True
  345.          BackColor       =   &H00C0C0C0&
  346.          BevelInner      =   0  ' 0 - None
  347.          BevelOuter      =   0  ' 0 - None
  348.          BevelWidth      =   2
  349.          BorderHorizontal=   2
  350.          BorderVertical  =   2
  351.          BorderWidth     =   2
  352.          DecayRate       =   100
  353.          Direction       =   1  ' 1 - Backward
  354.          Height          =   3000
  355.          Index           =   3
  356.          LEDColor        =   LEDTEST.FRX:30D8
  357.          LEDHeight       =   6
  358.          LEDIndex        =   0
  359.          LEDSep          =   0
  360.          LEDStyle        =   0  ' 0 - Rectangular
  361.          LEDWidth        =   15
  362.          Left            =   1140
  363.          MaxDecay        =   -1  'True
  364.          Mode            =   0  ' 0 - Value
  365.          MouseControl    =   0   'False
  366.          NumLEDs         =   32
  367.          Orientation     =   1  ' 1 - Vertical
  368.          TabIndex        =   15
  369.          Top             =   300
  370.          Value           =   0
  371.          Width           =   345
  372.       End
  373.       Begin LED LED5 
  374.          AutoSize        =   -1  'True
  375.          BackColor       =   &H00C0C0C0&
  376.          BevelInner      =   0  ' 0 - None
  377.          BevelOuter      =   0  ' 0 - None
  378.          BevelWidth      =   2
  379.          BorderHorizontal=   2
  380.          BorderVertical  =   2
  381.          BorderWidth     =   2
  382.          DecayRate       =   100
  383.          Direction       =   1  ' 1 - Backward
  384.          Height          =   3000
  385.          Index           =   2
  386.          LEDColor        =   LEDTEST.FRX:31A0
  387.          LEDHeight       =   6
  388.          LEDIndex        =   0
  389.          LEDSep          =   0
  390.          LEDStyle        =   0  ' 0 - Rectangular
  391.          LEDWidth        =   15
  392.          Left            =   840
  393.          MaxDecay        =   -1  'True
  394.          Mode            =   0  ' 0 - Value
  395.          MouseControl    =   0   'False
  396.          NumLEDs         =   32
  397.          Orientation     =   1  ' 1 - Vertical
  398.          TabIndex        =   14
  399.          Top             =   300
  400.          Value           =   0
  401.          Width           =   345
  402.       End
  403.       Begin LED LED5 
  404.          AutoSize        =   -1  'True
  405.          BackColor       =   &H00C0C0C0&
  406.          BevelInner      =   0  ' 0 - None
  407.          BevelOuter      =   0  ' 0 - None
  408.          BevelWidth      =   2
  409.          BorderHorizontal=   2
  410.          BorderVertical  =   2
  411.          BorderWidth     =   2
  412.          DecayRate       =   100
  413.          Direction       =   1  ' 1 - Backward
  414.          Height          =   3000
  415.          Index           =   1
  416.          LEDColor        =   LEDTEST.FRX:3268
  417.          LEDHeight       =   6
  418.          LEDIndex        =   0
  419.          LEDSep          =   0
  420.          LEDStyle        =   0  ' 0 - Rectangular
  421.          LEDWidth        =   15
  422.          Left            =   540
  423.          MaxDecay        =   -1  'True
  424.          Mode            =   0  ' 0 - Value
  425.          MouseControl    =   0   'False
  426.          NumLEDs         =   32
  427.          Orientation     =   1  ' 1 - Vertical
  428.          TabIndex        =   13
  429.          Top             =   300
  430.          Value           =   0
  431.          Width           =   345
  432.       End
  433.       Begin LED LED5 
  434.          AutoSize        =   -1  'True
  435.          BackColor       =   &H00C0C0C0&
  436.          BevelInner      =   0  ' 0 - None
  437.          BevelOuter      =   0  ' 0 - None
  438.          BevelWidth      =   2
  439.          BorderHorizontal=   2
  440.          BorderVertical  =   2
  441.          BorderWidth     =   2
  442.          DecayRate       =   100
  443.          Direction       =   1  ' 1 - Backward
  444.          Height          =   3000
  445.          Index           =   0
  446.          LEDColor        =   LEDTEST.FRX:3330
  447.          LEDHeight       =   6
  448.          LEDIndex        =   0
  449.          LEDSep          =   0
  450.          LEDStyle        =   0  ' 0 - Rectangular
  451.          LEDWidth        =   15
  452.          Left            =   240
  453.          MaxDecay        =   -1  'True
  454.          Mode            =   0  ' 0 - Value
  455.          MouseControl    =   0   'False
  456.          NumLEDs         =   32
  457.          Orientation     =   1  ' 1 - Vertical
  458.          TabIndex        =   3
  459.          Top             =   300
  460.          Value           =   0
  461.          Width           =   345
  462.       End
  463.    End
  464.    Begin Timer Timer1 
  465.       Interval        =   150
  466.       Left            =   90
  467.       Top             =   180
  468.    End
  469.    Begin LED LED3 
  470.       AutoSize        =   -1  'True
  471.       BackColor       =   &H00C0C0C0&
  472.       BevelInner      =   0  ' 0 - None
  473.       BevelOuter      =   2  ' 2 - Inset
  474.       BevelWidth      =   2
  475.       BorderHorizontal=   0
  476.       BorderVertical  =   2
  477.       BorderWidth     =   0
  478.       DecayRate       =   60
  479.       Direction       =   0  ' 0 - Forward
  480.       Height          =   510
  481.       LEDColor        =   LEDTEST.FRX:33F8
  482.       LEDHeight       =   26
  483.       LEDIndex        =   0
  484.       LEDSep          =   0
  485.       LEDStyle        =   2  ' 2 - Bitmap
  486.       LEDWidth        =   23
  487.       Left            =   930
  488.       MaxDecay        =   -1  'True
  489.       Mode            =   0  ' 0 - Value
  490.       MouseControl    =   -1  'True
  491.       NumLEDs         =   15
  492.       OffPictureGreen =   LEDTEST.FRX:34C0
  493.       OffPictureRed   =   LEDTEST.FRX:368A
  494.       OffPictureYellow=   LEDTEST.FRX:3854
  495.       OnPictureGreen  =   LEDTEST.FRX:3A1E
  496.       OnPictureRed    =   LEDTEST.FRX:3BE8
  497.       OnPictureYellow =   LEDTEST.FRX:3DB2
  498.       Orientation     =   0  ' 0 - Horizontal
  499.       TabIndex        =   1
  500.       Top             =   3720
  501.       Value           =   20
  502.       Width           =   5235
  503.    End
  504.    Begin LED LED1 
  505.       AutoSize        =   0   'False
  506.       BackColor       =   &H00C0C0C0&
  507.       BackgroundPicture=   LEDTEST.FRX:3F7C
  508.       BevelInner      =   0  ' 0 - None
  509.       BevelOuter      =   1  ' 1 - Raised
  510.       BevelWidth      =   2
  511.       BorderHorizontal=   20
  512.       BorderVertical  =   1
  513.       BorderWidth     =   4
  514.       DecayRate       =   30
  515.       Direction       =   1  ' 1 - Backward
  516.       Height          =   3345
  517.       LEDColor        =   LEDTEST.FRX:4E42
  518.       LEDHeight       =   11
  519.       LEDIndex        =   0
  520.       LEDSep          =   0
  521.       LEDStyle        =   0  ' 0 - Rectangular
  522.       LEDWidth        =   11
  523.       Left            =   3960
  524.       MaxDecay        =   0   'False
  525.       Mode            =   0  ' 0 - Value
  526.       MouseControl    =   -1  'True
  527.       NumLEDs         =   15
  528.       Orientation     =   1  ' 1 - Vertical
  529.       TabIndex        =   0
  530.       Top             =   120
  531.       Value           =   7
  532.       Width           =   915
  533.    End
  534.    Begin Label Label1 
  535.       BackStyle       =   0  'Transparent
  536.       Caption         =   "Try clicking or sliding the LEDs"
  537.       Height          =   195
  538.       Left            =   450
  539.       TabIndex        =   17
  540.       Top             =   30
  541.       Width           =   2715
  542.    End
  543. Dim theta(5) As Single
  544. Dim rates(5) As Single
  545. Sub Form_Load ()
  546.     Randomize
  547.     For i = 0 To 4
  548.         theta(i) = Rnd(1) * 3.14159
  549.         rates(i) = .2 * Rnd(1)
  550.     Next
  551. End Sub
  552. Sub LED2_Click ()
  553.     led4 = led2
  554. End Sub
  555. Sub LED4_Click ()
  556.     led2 = led4
  557. End Sub
  558. Sub Timer1_Timer ()
  559.     For i = 0 To 3
  560.         Randomize
  561.         led5(i) = 32 * Sin(theta(i)) ^ 2
  562.         theta(i) = theta(i) + rates(i)
  563.     Next
  564. End Sub
  565. Sub Timer2_Timer ()
  566.     led10 = Rnd(1) * 32767
  567. End Sub
  568.